import request from '@/utils/request'
/*
试卷管理
 */


/**
 * 试卷管理分页查询
 * @param data
 * @returns {AxiosPromise}
 */
export function page(data) {
  return request({
    url: '/api/ts/examination_paper/page',
    method: 'post',
    data
  })
}


/**
 * 保存固定试卷
 * @param data
 * @returns {AxiosPromise}
 */
export function saveFixedPaper(data) {
  return request({
    url: '/api/ts/examination_paper/save_fixed_paper',
    method: 'post',
    data
  })
}

/**
 * 编辑固定试卷添加试题
 * @param data
 * @returns {AxiosPromise}
 */
export function saveQuestionSingle(data) {
  return request({
    url: '/api/ts/examination_paper/save_question_single',
    method: 'post',
    data
  })
}


/**
 * 删除试卷试题 通过试卷id和试题id
 * @param data
 * @returns {AxiosPromise}
 */
export function deleteQuestionSingle(data) {
  return request({
    url: '/api/ts/examination_paper/delete_question_single',
    method: 'post',
    data
  })
}

/**
 * 预览试卷
 * @param data
 * @returns {AxiosPromise}
 */
export function preview(data) {
  return request({
    url: '/api/ts/examination_paper/preview',
    method: 'post',
    data
  })
}

/**
 * 预览试卷
 * @param data
 * @returns {AxiosPromise}
 */
export function startExamination(data) {
  return request({
    url: '/api/ts/examination_paper/start_examination',
    method: 'post',
    data
  })
}


/**
 * 获取固定试卷信息
 * @param data
 * @returns {AxiosPromise}
 */
export function getFixed(data) {
  return request({
    url: '/api/ts/examination_paper/get_fixed',
    method: 'post',
    data
  })
}


/**
 * 完善固定试卷信息
 * @param data
 * @returns {AxiosPromise}
 */
export function refineFixedPaper(data) {
  return request({
    url: '/api/ts/examination_paper/refine_fixed_paper',
    method: 'post',
    data
  })
}

/**
 * 删除试卷
 * @param data
 * @returns {AxiosPromise}
 */
export function deleteExaminationPaper(data) {
  return request({
    url: '/api/ts/examination_paper/delete',
    method: 'post',
    data
  })
}


/**
 * 初始化随机试卷
 * @param data
 * @returns {AxiosPromise}
 */
export function saveRandom(data) {
  return request({
    url: '/api/ts/examination_paper/save_random',
    method: 'post',
    data
  })
}


/**
 * 初始化随机试卷
 * @param data
 * @returns {AxiosPromise}
 */
export function generateRandomPaper(data) {
  return request({
    url: '/api/ts/examination_paper/generate_random_paper',
    method: 'post',
    data
  })
}


/**
 * 初始化随机试卷
 * @param data
 * @returns {AxiosPromise}
 */
export function deleteMultiple(data) {
  return request({
    url: '/api/ts/examination_paper/delete_multiple',
    method: 'post',
    data
  })
}

/**
 * 编辑试卷
 * @param data
 * @returns {AxiosPromise}
 */
export function examinationPaperUpdate(data) {
  return request({
    url: '/api/ts/examination_paper/update',
    method: 'post',
    data
  })
}

